//
//  AppMyOrderListController.m
//  gungunchou
//
//  Created by lyzbmacos3 on 2018/12/7.
//  Copyright © 2018年 xskj. All rights reserved.
//

#import "AppMyOrderListController.h"
#import "AppOrderListController.h"

@interface AppMyOrderListController ()
@property (nonatomic, copy) NSArray *controllerArr;
@end

@implementation AppMyOrderListController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.automaticallyAdjustsScrollViewInsets = NO;
    self.controllerArr = NSArray.new;
    self.segmentControl.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 44);
    self.navigationItem.title = @"订单列表";
    if (self.navigationController.viewControllers.count <= 1) {
        self.navigationItem.hidesBackButton = YES;
    }
    else {
        self.navigationItem.hidesBackButton = NO;
    }
    
    NSMutableArray *tempArr = NSMutableArray.new;
    NSArray *titles = @[@"全部",@"待发货",@"已发货"];
    for (int i = 1; i < 4; i ++) {
        AppOrderListController *con = AppOrderListController.new;
        con.orderStatus = [NSString stringWithFormat:@"%d",i];
        con.title = titles[i-1];
        [tempArr addObject:con];
    }
    self.controllerArr = [NSArray arrayWithArray:tempArr];
    self.viewControllers = self.controllerArr;
    
}

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:NO];
}

@end
